﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace MyPlanSilverlight.Utils
{
    public class Response
    {
        public static Response Init(string jsonString)
        {
             return JsonUtils.toEntity<Response>(jsonString);
        }


        public int Status { get; set; }

        public Object Data { get; set; }

        public T toEntity<T>() where T : new()
        {
            return JsonUtils.toEntity<T>(Data.ToString());
        }

        public List<T> toEntityList<T>() where T : new()
        {
            return JsonUtils.toEntityList<T>(Data.ToString());
        }
    }
}
